package character.writer;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
//图片加密解密，2次亦或就是取到原值
public class ImageTest {
    public static void main(String[] args) throws IOException {
        FileInputStream fis=new FileInputStream("G:\\Javatest2\\character\\writer\\image.jpg");
        ArrayList<Integer> list=new ArrayList<>();
        int i;
        while((i=fis.read())!=-1){
            list.add(i);
        }
        fis.close();
//        创建输出流对象
        FileOutputStream fos=new FileOutputStream("G:\\Javatest2\\character\\writer\\image.jpg");
        for (Integer myByte : list) {
            fos.write(myByte^2);
            
        }
        //输出流对象关闭
        fos.close();
    }
}
